class Solution {
public:
    bool isPalindrome(string s) {
        string str;
        for (auto ch : s)
        {
            if (isalpha(ch))
            {
                str.push_back(tolower(ch));
            }
            else if (isdigit(ch))
            {
                str.push_back(ch);
            }
        }
        string tmp = str;
        reverse(str.begin(), str.end());
        return tmp == str;
    }
};